OPC-UA Embedded Server SDK  2.0.4
Public interface

Data Structures

struct  UA_UTF8_string_t
 Represents a UTF8 string for translation of human readable text. More...
 
struct  UA_Byte_string_t
 Represents a variable length byte string. More...
 
union  UA_Value_t
 The valid pointer types for a read or write operation by the stack on host maintained variables (node value attributes) via read and write callbacks. More...
 
struct  UA_Configuration_BuildInfo_t
 The configuration structure for the UA Server BuildInfo object. More...
 
struct  UA_Configuration_TcpBinary_t
 The configuration structure for the UA Server TCP Binary Layer. More...
 
struct  UA_Configuration_SecureConversation_t
 The configuration structure for the UA Server Secure Conversation Layer. More...
 
struct  UA_Configuration_Security_t
 The configuration structure for the UA Server Security Policies. More...
 
struct  UA_Configuration_Intervals_t
 The configuration structure for the Server Intervals. More...
 
struct  UA_Configuration_Services_t
 The configuration structure for the UA Server Services. More...
 
struct  UA_Configuration_NamespaceArray_t
 The configuration structure for the Namespace Array. More...
 
struct  UA_Configuration_AddressSpace_t
 The configuration structure for the UA Server Address Space. More...
 
struct  UA_Configuration_CertManagement_t
 The configuration structure for the UA Server Certificate Management. More...
 
struct  UA_Configuration_Locales_t
 The configuration structure for the UA Server Locale Handling. More...
 
struct  UA_Configuration_ProfileArray_t
 The configuration structure for the UA Server Profile Array. More...
 
struct  UA_Configuration_OperationLimits_t
 The configuration structure for the UA Server Operation Limits object. More...
 
struct  UA_Configuration_ServerCapabilities_t
 The configuration structure for the UA Server Capabilities object. More...
 
struct  UA_Configuration_Internals_t
 The configuration structure for the UA Server miscellaneous internals. More...
 
struct  UA_Configuration_Diagnostics_t
 The configuration structure for the UA Server diagnostics. More...
 
struct  UA_Configuration_Filters_t
 The configuration structure for the UA Server Filters. More...
 
struct  UA_Configuration_t
 The configuration structure for the UA Server. More...
 
struct  UA_NodeId_Config_t
 Optionally specifies a non-opaque node id for an address space node. More...
 
struct  UA_Base_t
 A configuration structure for all address space nodes. More...
 
struct  UA_File_t
 A configuration structure for Method address space nodes. More...
 
struct  UA_Method_t
 A configuration structure for File address space nodes. More...
 
struct  UA_BaseDataVariable_t
 A configuration structure for BaseDataVariable address space nodes. More...
 
struct  UA_DataItem_t
 A configuration structure for DataItem address space nodes. More...
 
struct  UA_Range_t
 Range data type. More...
 
struct  UA_EUInformation_t
 Engineering Units configuration (see user manual for description) More...
 
struct  UA_AnalogItem_t
 A configuration structure for AnalogItem address space nodes. More...
 
struct  UA_TwoStateDiscrete_t
 A configuration structure for TwoStateDiscrete address space nodes. More...
 
struct  UA_MultiStateDiscrete_t
 A configuration structure for MultiStateDiscrete address space nodes. More...
 

Macros

#define UA_SDK_SOFTWARE_VERSION   "MatrikonOPC OPC-UA Embedded Server SDK Version 2.0.4"
 
#define UA_MAX_ALIGNMENT   8
 
#define UA_BIG_ENDIAN   0
 
#define UA_CROSS_ENDIAN_DOUBLE   0
 
#define UA_INCLUDE_SUBSCRIPTIONS   1
 
#define UA_INCLUDE_MON_ITEM_TRIGGERING   1
 
#define UA_INCLUDE_STANDARD_ADDRESS_SPACE   1
 
#define UA_OVERLOAD_NEW_AND_DELETE   0
 
#define UA_INCLUDE_CPP_STD_LIB_DEPS   0
 
#define UA_NO_THROW   throw()
 
#define UA_STANDARD_NODES_SECTION_ATTRIBUTE_PREFIX
 
#define UA_STANDARD_NODES_SECTION_ATTRIBUTE_POSTFIX
 
#define UA_INCLUDE_APP_DEFINED_NODE_IDS   0
 
#define UA_USE_OPENSSL   0
 
#define UA_USE_MATRIXSSL   0
 
#define UA_MATRIXSSL_SUPPORT_SECURITY_POLICY_BASIC256   0
 
#define UA_MATRIXSSL_SUPPORT_CERTIFICATE_GENERATION   0
 
#define APPLICATION_RSA_KEY_LENGTH   1024
 
#define UA_INCLUDE_READ_DEFERRALS   0
 
#define UA_INCLUDE_ASYNC_OPS   0
 
#define UA_MUTEX_T   void
 
#define ALLOW_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_NONE   0
 
#define UA_PRODUCT_URI   "PRODUCT_URI"
 The configuration for the UA Server BuildInfo object. More...
 
#define UA_PRODUCT_NAME   "PRODUCT_NAME"
 
#define UA_MANUFACTURER_NAME   "MANUFACTURER_NAME"
 
#define UA_SOFTWARE_VERSION   "SOFTWARE_VERSION"
 
#define UA_BUILD_NUMBER   "BUILD_NUMBER"
 
#define UA_BUILD_DATE   0
 
#define UA_USER_TOKEN_POLICY_ANONYMOUS_TOKEN_SECURITY_POLICY_NONE   (1<<0)
 Bit definitions for the UA Server Security Configuration bitmaps. More...
 
#define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_NONE   (1<<1)
 
#define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_Basic128Rsa15   (1<<2)
 
#define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_Basic256   (1<<3)
 
#define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_Basic256Sha256   (1<<4)
 
#define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_NONE   (1<<5)
 
#define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_Basic128Rsa15   (1<<6)
 
#define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_Basic256   (1<<7)
 
#define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_Basic256Sha256   (1<<8)
 
#define OB_SUPPRESS_CERTIFICATE_EXPIRED   (1<<0)
 Bit definitions for a bitmap that allows you to modify the behaviour of the OPC UA Secure Channel Client Certificate handling. More...
 
#define OB_SUPPRESS_HOSTNAME_INVALID   (1<<1)
 
#define OB_SUPPRESS_REVOCATION_STATUS_UNKNOWN   (1<<2)
 
#define OB_CHECK_REVOCATION_STATUS_ONLINE   (1<<3)
 
#define OB_CHECK_REVOCATION_STATUS_OFFLINE   (1<<4)
 
#define OB_USE_DEFAULT_OPTIONS   (1<<5)
 
#define OB_TRUST_ALL_CLIENTS_WHEN_TRUST_LIST_IS_EMPTY   (1U<<31)
 

Typedefs

typedef uint32_t UA_Status_t
 Represents an OPC-UA status code. More...
 
typedef UA_Byte_string_t UA_Xml_element_t
 A structure representing XMLElement values. More...
 
typedef UA_Byte_string_t UA_Var_string_t
 A structure representing UTF8 string values. More...
 
typedef uint8_t * UA_GUID_t
 Represents a GUID as a pointer to an array of 16 bytes. More...
 
typedef UA_Base_t UA_Folder_t
 A configuration structure for Folder address space nodes. More...
 
typedef UA_Folder_t UA_View_t
 A configuration structure for View address space nodes. More...
 

Enumerations

enum  UA_Value_type_t {
  UA_TYPE_Invalid = 0,
  UA_TYPE_Boolean = 1,
  UA_TYPE_SByte = 2,
  UA_TYPE_Byte = 3,
  UA_TYPE_Int16 = 4,
  UA_TYPE_UInt16 = 5,
  UA_TYPE_Int32 = 6,
  UA_TYPE_UInt32 = 7,
  UA_TYPE_Int64 = 8,
  UA_TYPE_UInt64 = 9,
  UA_TYPE_Float = 10,
  UA_TYPE_Double = 11,
  UA_TYPE_String = 12,
  UA_TYPE_DateTime = 13,
  UA_TYPE_Guid = 14,
  UA_TYPE_ByteString = 15,
  UA_TYPE_XmlElement = 16,
  UA_TYPE_NodeId = 17,
  UA_TYPE_ExpandedNodeId = 18,
  UA_TYPE_StatusCode = 19,
  UA_TYPE_QualifiedName = 20,
  UA_TYPE_LocalizedText = 21,
  UA_TYPE_ExtensionObject = 22,
  UA_TYPE_DataValue = 23,
  UA_TYPE_Variant = 24,
  UA_TYPE_Range = 884,
  UA_TYPE_EUInformation = 887
}
 
enum  UA_Server_state_t {
  opcua_server_state_running = 0,
  opcua_server_state_failed = 1,
  opcua_server_state_no_configuration = 2,
  opcua_server_state_suspended = 3,
  opcua_server_state_shutdown = 4,
  opcua_server_state_test = 5,
  opcua_server_state_communication_fault = 6,
  opcua_server_state_unknown = 7,
  end
}
 Enumeration of server state. More...
 
enum  UA_Log_severity_t {
  UA_LOG_SEVERITY_ERROR = 0,
  UA_LOG_SEVERITY_INFO = 1
}
 Enumeration of log message severity. More...
 
enum  UA_Log_payload_t {
  UA_LOG_PAYLOAD_NONE = 0,
  UA_LOG_PAYLOAD_CSTRING = 1,
  UA_LOG_PAYLOAD_BINARY = 2
}
 Enumeration of log message data payload type. More...
 
enum  UA_Mon_Item_Callback_Operation_t {
  UA_MON_ITEM_CREATED = 0,
  UA_MON_ITEM_MODIFIED = 1,
  UA_MON_ITEM_DESTROYED = 2
}
 Enumeration of monitored item callabck operation type. More...
 
enum  UA_NodeId_Identifier_Type_t {
  opcua_node_encoding_numeric = 0x02,
  opcua_node_encoding_string = 0x03,
  opcua_node_encoding_guid = 0x04,
  opcua_node_encoding_bytestring = 0x05
}
 Node id encoding types for an address space node. More...
 
enum  UA_Asym_Cipher_t {
  UA_ASYM_CIPHER_INVALID = 0,
  UA_ASYM_CIPHER_RSA_PKCS1_v1_5 = 1,
  UA_ASYM_CIPHER_RSA_OAEP = 2
}
 Enumeration of asymmetric cipher types. More...
 
enum  UA_Sym_Cipher_t {
  UA_SYM_CIPHER_INVALID = 0,
  UA_SYM_CIPHER_AES_128_CBC = 1,
  UA_SYM_CIPHER_AES_256_CBC = 2
}
 Enumeration of symmetric cipher types. More...
 
enum  UA_Digest_t {
  UA_DIGEST_INVALID = 0,
  UA_DIGEST_SHA1 = 1,
  UA_DIGEST_SHA256 = 2
}
 Enumeration of message digest types. More...
 
enum  UA_Security_policy_t {
  SECURITY_POLICY_INVALID,
  SECURITY_POLICY_NONE,
  SECURITY_POLICY_BASIC128RSA15,
  SECURITY_POLICY_BASIC256,
  SECURITY_POLICY_BASIC256SHA256
}
 Enumeration of message security policies. More...
 
enum  UA_Certificate_Type_t {
  UA_CERT_TYPE_INVALID = 0,
  UA_CERT_TYPE_CLIENT_APPLICATION = 1,
  UA_CERT_TYPE_SERVER_APPLICATION = 2,
  UA_CERT_TYPE_APPLICATION_CA = 3,
  UA_CERT_TYPE_USER = 4,
  UA_CERT_TYPE_USER_CA = 5
}
 Enumeration of X509 certificate types. More...
 

Functions

uint32_t UAServer_Callback_millisecond (void)
 
uint32_t UAServer_Callback_pseudeo_random_number (void)
 
void * UAServer_Callback_memcpy (void *destination, const void *source, size_t num)
 
void * UAServer_Callback_memchr (const void *ptr, int32_t value, size_t num)
 
void * UAServer_Callback_memset (void *ptr, int32_t value, size_t num)
 
int UAServer_Callback_memcmp (const void *ptr1, const void *ptr2, size_t num)
 
char * UAServer_Callback_strncpy (char *destination, const char *source, size_t num)
 
void * UAServer_Callback_malloc (size_t size)
 
void UAServer_Callback_free (void *ptr)
 
int64_t UAServer_Callback_datetime (void)
 
void UAServer_Callback_read (uint32_t node_handle, UA_Value_type_t value_type, uint32_t max_array_length, uintptr_t read_context)
 
UA_Status_t UAServer_Perform_read (uintptr_t read_context, UA_Value_t data_value, int64_t source_timestamp, UA_Status_t status_code)
 
bool_t UAServer_Is_read_operation_asynchronous (uintptr_t read_context)
 
bool_t UAServer_Is_read_operation_deferrable (uintptr_t read_context)
 
bool_t UAServer_Is_read_operation_deferred (uintptr_t read_context)
 
UA_Status_t UAServer_Defer_read_operation (uintptr_t read_context, uintptr_t *deferral_handle)
 
UA_Status_t UAServer_Read_deferral_complete (uintptr_t deferral_handle, UA_Status_t status_code)
 
void UAServer_Callback_deferred_read_operation_aborted (uintptr_t deferral_handle)
 
void UAServer_Callback_write (uint32_t node_handle, UA_Value_type_t value_type, UA_Status_t status_code, uint32_t max_array_length, uintptr_t write_context)
 
UA_Status_t UAServer_Perform_write (uintptr_t write_context, UA_Value_t data_value, int64_t *source_timestamp, bool_t completes_asynchronously, uint32_t *new_length_of_array)
 
void UAServer_Set_write_operation_level_result_code (uintptr_t write_context, UA_Status_t result_code)
 
void UAServer_Callback_monitored_item (uint32_t node_handle, uint32_t monitored_item_id, UA_Mon_Item_Callback_Operation_t operation, uint64_t sampling_interval_ms)
 
const UA_UTF8_string_t * UAServer_Callback_translate (uint16_t locale_index, uint32_t text_handle)
 
const UA_UTF8_string_t * UAServer_Callback_translate_enumstrings (uint16_t locale_index, uint32_t enum_handle, uint16_t enum_index)
 
const UA_UTF8_string_t * UAServer_Callback_translate_internal_text (uint16_t locale_index, uint32_t text_index)
 
bool_t UAServer_Callback_login_username_password (const UA_UTF8_string_t *username, const UA_UTF8_string_t *password, uint16_t *user_index)
 
bool_t UAServer_Callback_login_x509_certificate (const UA_Byte_string_t *certificate, const UA_UTF8_string_t *thumbprint, uint16_t *user_index)
 
void UAServer_Callback_File_Size (uint32_t node_handle, uintptr_t context)
 
UA_Status_t UAServer_File_Size_result (uintptr_t context, uint64_t size, UA_Status_t result)
 
void UAServer_Callback_File_Open (uint32_t node_handle, uint8_t mode, uintptr_t context)
 
UA_Status_t UAServer_File_Open_result (uintptr_t context, uint32_t file_handle, UA_Status_t result)
 
void UAServer_Callback_File_Close (uint32_t node_handle, uint32_t file_handle, uintptr_t context)
 
UA_Status_t UAServer_File_Close_result (uintptr_t context, UA_Status_t result)
 
void UAServer_Callback_File_Read (uint32_t node_handle, uint32_t file_handle, int32_t length, uintptr_t context)
 
UA_Status_t UAServer_File_Read_result (uintptr_t context, UA_Byte_string_t data, UA_Status_t result)
 
void UAServer_Callback_File_Write (uint32_t node_handle, uint32_t file_handle, UA_Byte_string_t data, uintptr_t context)
 
UA_Status_t UAServer_File_Write_result (uintptr_t context, UA_Status_t result)
 
void UAServer_Callback_File_GetPosition (uint32_t node_handle, uint32_t file_handle, uintptr_t context)
 
UA_Status_t UAServer_File_GetPosition_result (uintptr_t context, uint64_t position, UA_Status_t result)
 
void UAServer_Callback_File_SetPosition (uint32_t node_handle, uint32_t file_handle, uint64_t position, uintptr_t context)
 
UA_Status_t UAServer_File_SetPosition_result (uintptr_t context, UA_Status_t result)
 
int64_t UAServer_Get_datetime (void)
 
void UAServer_Time_emulation_enabled (bool_t enable)
 
UA_Status_t UAServer_Initialise (const UA_Configuration_t *config)
 
void UAServer_Terminate (void)
 
UA_Status_t UAServer_memory_info (uint32_t *total_memory_provided, uint32_t *memory_unusable, uint32_t *max_memory_used_this_run, uint32_t *total_memory_recommended)
 
UA_Status_t UAServer_Set_URI (const char *uri)
 
UA_Status_t UAServer_Start (const char *license)
 
UA_Status_t UAServer_Stop (void)
 
UA_Server_state_t UAServer_Get_state (bool_t *shutdown_complete)
 
UA_Status_t UAServer_Generate_certificate (void)
 
UA_Status_t UAServer_Get_certificate_size (uint32_t *size_in_bytes)
 
UA_Status_t UAServer_Read_certificate (UA_Byte_string_t *certificate)
 
UA_Status_t UAServer_Write_certificate (UA_Byte_string_t *certificate)
 
UA_Status_t UAServer_Add_IP_address (uint8_t *ip_address)
 
UA_Status_t UAServer_Clear_all_IP_addresses (void)
 
UA_Status_t UAServer_Add_hostname (const char *hostname)
 
UA_Status_t UAServer_Clear_all_hostnames (void)
 
UA_Status_t UAServer_New_connection (uint64_t connection_id)
 
UA_Status_t UAServer_Connection_closed (uint64_t connection_id)
 
void UAServer_Callback_close_connection (uint64_t connection_id)
 
UA_Status_t UAServer_New_data_received (void *read_context, uint64_t connection_id)
 
bool_t UAServer_Callback_data_receive (void *application_context, uint64_t connection_id, uint8_t *buffer, uint32_t max_length_in_bytes, uint32_t *no_of_bytes_received)
 
UA_Status_t UAServer_Get_data_to_send (void *write_context, uint64_t connection_id)
 
bool_t UAServer_Callback_data_send (void *application_context, uint64_t connection_id, uint8_t *buffer, uint32_t no_of_bytes_to_send, uint32_t *no_of_bytes_sent)
 
UA_Status_t UAServer_Ready_to_receive (uint64_t connection_id, bool_t *result)
 
void UAServer_Poll (void)
 
UA_Status_t UAServer_Delete_all_nodes (void)
 
UA_Status_t UAServer_Delete_node (uint32_t node_handle)
 
void UAServer_Init_config_structure_Folder (UA_Folder_t *configuration)
 
UA_Status_t UAServer_Create_Folder (const UA_Folder_t *configuration)
 
void UAServer_Init_config_structure_View (UA_View_t *configuration)
 
UA_Status_t UAServer_Create_View (const UA_View_t *configuration)
 
void UAServer_Init_config_structure_Method (UA_Method_t *configuration)
 
UA_Status_t UAServer_Create_Method (const UA_Method_t *configuration)
 
void UAServer_Init_config_structure_BaseDataVariable (UA_BaseDataVariable_t *configuration)
 
UA_Status_t UAServer_Create_BaseDataVariable (const UA_BaseDataVariable_t *configuration)
 
void UAServer_Init_config_structure_DataItem (UA_DataItem_t *configuration)
 
UA_Status_t UAServer_Create_DataItem (const UA_DataItem_t *configuration)
 
void UAServer_Init_config_structure_AnalogItem (UA_AnalogItem_t *configuration)
 
UA_Status_t UAServer_Create_AnalogItem (const UA_AnalogItem_t *configuration)
 
void UAServer_Init_config_structure_TwoStateDiscrete (UA_TwoStateDiscrete_t *configuration)
 
UA_Status_t UAServer_Create_TwoStateDiscrete (const UA_TwoStateDiscrete_t *configuration)
 
void UAServer_Init_config_structure_MultiStateDiscrete (UA_MultiStateDiscrete_t *configuration)
 
UA_Status_t UAServer_Create_MultiStateDiscrete (const UA_MultiStateDiscrete_t *configuration)
 
void UAServer_Init_config_structure_File (UA_File_t *configuration)
 
UA_Status_t UAServer_Create_File (const UA_File_t *configuration)
 
UA_Status_t UAServer_Add_to_folder (uint32_t folder_handle, uint32_t node_handle)
 
UA_Status_t UAServer_Add_to_folder_with_view_mask (uint32_t folder_handle, uint32_t node_handle, uint16_t view_mask)
 
UA_Status_t UAServer_Add_to_objects_folder (uint32_t node_handle)
 
void UAServer_Callback_log (UA_Log_severity_t severity, int64_t timestamp, const char *file_name, uint32_t line_number, UA_Log_payload_t payload_type, const void *payload, uint32_t payload_length)
 
void UAServer_Printf (int64_t timestamp, const char *format,...)
 
void * UAServer_Malloc (size_t size)
 
void * UAServer_Calloc (size_t size)
 
void * UAServer_Realloc (void *ptr, size_t size)
 
void UAServer_Free (void *ptr)
 
UA_Status_t UASecurity_Check_application_certificate_exists (void)
 
UA_Status_t UASecurity_Create_self_signed_certificate (const UA_Configuration_t *sdk_configuration, const char *server_uri, const char **hostnames, int no_of_hostnames, const char **ip_addresses, int no_of_ip_addresses)
 
UA_Status_t UASecurity_Reload_directory_stores_now (void)
 
void UASecurity_Reload_directory_stores_before_each_validation (bool_t enable)
 
UA_Status_t UASecurity_Create_directory_stores (void)
 
void UASecurity_Set_validation_options (uint32_t option_bits)
 
UA_Status_t UASecurity_Get_thumbprint (const char *filepath, char *thumbprint, uint32_t thumbprint_max_length)
 
void UASecurity_Callback_get_private_key_password (UA_Var_string_t *password)
 
void UASecurity_Callback_certificate_added_to_rejected_list (UA_Certificate_Type_t type)
 

Detailed Description

Macro Definition Documentation

#define UA_SDK_SOFTWARE_VERSION   "MatrikonOPC OPC-UA Embedded Server SDK Version 2.0.4"

SDK Software Version String (Do not change)

Definition at line 23 of file ua_server_config_template.h.

#define UA_MAX_ALIGNMENT   8

SDK License description (Do not change)

Definition at line 29 of file ua_server_config_template.h.

#define UA_BIG_ENDIAN   0

Endianess of target Set to 0 for little endian and 1 for big endian

Definition at line 37 of file ua_server_config_template.h.

#define UA_CROSS_ENDIAN_DOUBLE   0

Endianess of target floating point unit Set to 1 for cross endian double or 0 for everything else

Definition at line 45 of file ua_server_config_template.h.

#define UA_INCLUDE_SUBSCRIPTIONS   1

Support Subscriptions and Monitored Items Set to 0 for no support, 1 for support

Definition at line 53 of file ua_server_config_template.h.

#define UA_INCLUDE_MON_ITEM_TRIGGERING   1

Support Monitored Item Triggering Set to 0 for no support, 1 for support

Definition at line 61 of file ua_server_config_template.h.

#define UA_INCLUDE_STANDARD_ADDRESS_SPACE   1

Include standard type information in address space Set to 0 to omit, 1 to include

Definition at line 69 of file ua_server_config_template.h.

#define UA_OVERLOAD_NEW_AND_DELETE   0

Include empty implementations of new and delete Set to 0 to omit, 1 to include

Definition at line 77 of file ua_server_config_template.h.

#define UA_INCLUDE_CPP_STD_LIB_DEPS   0

Include C++ standard library dependencies Set to 0 to omit, 1 to include

Definition at line 85 of file ua_server_config_template.h.

#define UA_NO_THROW   throw()

Some compilers do not allow throw() when exceptions are disabled. Altering this setting may cause hard faults on your platform in low memory conditions. Do not alter without consulting suppo.nosp@m.rt@m.nosp@m.atrik.nosp@m.onop.nosp@m.c.com.

Definition at line 94 of file ua_server_config_template.h.

#define UA_STANDARD_NODES_SECTION_ATTRIBUTE_PREFIX

Support placement of standard nodes in a specific data section Leave empty for default linker behaviour

Definition at line 102 of file ua_server_config_template.h.

#define UA_STANDARD_NODES_SECTION_ATTRIBUTE_POSTFIX

Support placement of standard nodes in a specific data section Leave empty for default linker behaviour

Definition at line 110 of file ua_server_config_template.h.

#define UA_INCLUDE_APP_DEFINED_NODE_IDS   0

Support application defined Node Ids (string or GUID types) Set to 0 for no support, 1 for support

Definition at line 118 of file ua_server_config_template.h.

#define UA_USE_OPENSSL   0

Support security Set to 0 for no support, 1 for supportUse OpenSSL security implementation Set to 0 for no support, 1 for support

Definition at line 134 of file ua_server_config_template.h.

#define UA_USE_MATRIXSSL   0

Use MatrixSSL security implementation Set to 0 for no support, 1 for support

Definition at line 142 of file ua_server_config_template.h.

#define UA_MATRIXSSL_SUPPORT_SECURITY_POLICY_BASIC256   0

Support SecurityPolicy Basic 256 with MatrixSSL. This feature requires MatrixSSL components not included in the openly available GPL version. While testing MatrixSSL in advance of a purchase set this macro to 0 to enable compilation. Set to 0 for no support, 1 for support

Definition at line 153 of file ua_server_config_template.h.

#define UA_MATRIXSSL_SUPPORT_CERTIFICATE_GENERATION   0

Support MatrixSSL certificate generation. This feature requires MatrixSSL components not included in the openly available GPL version. While testing MatrixSSL in advance of a purchase set this macro to 0 to enable compilation. Set to 0 for no support, 1 for support

Definition at line 164 of file ua_server_config_template.h.

#define APPLICATION_RSA_KEY_LENGTH   1024

Generated Certificate key length. Only used when security is included Set to 1024 or 2048 bits

Definition at line 172 of file ua_server_config_template.h.

#define UA_INCLUDE_READ_DEFERRALS   0

Support file transfer methods Set to 0 for no support, 1 for supportSupport deferral of read operations Set to 0 for no support, 1 for support

Definition at line 188 of file ua_server_config_template.h.

#define UA_INCLUDE_ASYNC_OPS   0

Support asynchronous operations Set to 0 for no support, 1 for support

Definition at line 196 of file ua_server_config_template.h.

#define UA_MUTEX_T   void

If including asynchronous operations define the platform mutex type here. Otherwise just set it to void.

Definition at line 204 of file ua_server_config_template.h.

#define ALLOW_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_NONE   0

Allow user certificates with no signing (major security risk) Set to 0 for no support, 1 for support

Definition at line 212 of file ua_server_config_template.h.

#define UA_PRODUCT_URI   "PRODUCT_URI"

The configuration for the UA Server BuildInfo object.

Product URI for BuildInfo Standard Node

Definition at line 220 of file ua_server_config_template.h.

#define UA_PRODUCT_NAME   "PRODUCT_NAME"

Product name for BuildInfo Standard Node

Definition at line 222 of file ua_server_config_template.h.

#define UA_MANUFACTURER_NAME   "MANUFACTURER_NAME"

Manufacturer name for BuildInfo Standard Node

Definition at line 224 of file ua_server_config_template.h.

#define UA_SOFTWARE_VERSION   "SOFTWARE_VERSION"

Software version for BuildInfo Standard Node

Definition at line 226 of file ua_server_config_template.h.

#define UA_BUILD_NUMBER   "BUILD_NUMBER"

Build number for BuildInfo Standard Node

Definition at line 228 of file ua_server_config_template.h.

#define UA_BUILD_DATE   0

Build date (Windows FileTime format) for BuildInfo Standard Node

Definition at line 230 of file ua_server_config_template.h.

#define UA_USER_TOKEN_POLICY_ANONYMOUS_TOKEN_SECURITY_POLICY_NONE   (1<<0)

Bit definitions for the UA Server Security Configuration bitmaps.

User Token Anonymous - Token Security Policy None

Definition at line 354 of file ua_types.h.

#define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_NONE   (1<<1)

User Token Username / Password - Token Security Policy None

Definition at line 357 of file ua_types.h.

#define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_Basic128Rsa15   (1<<2)

User Token Username / Password - Token Security Policy Basic128Rsa15

Definition at line 359 of file ua_types.h.

#define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_Basic256   (1<<3)

User Token Username / Password - Token Security Policy Basic256

Definition at line 361 of file ua_types.h.

#define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_Basic256Sha256   (1<<4)

User Token Username / Password - Token Security Policy Basic256Sha256

Definition at line 363 of file ua_types.h.

#define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_NONE   (1<<5)

User Token X509v3 Certificate - Token Security Policy None

Definition at line 366 of file ua_types.h.

#define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_Basic128Rsa15   (1<<6)

User Token X509v3 Certificate - Token Security Policy Basic128Rsa15

Definition at line 368 of file ua_types.h.

#define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_Basic256   (1<<7)

User Token X509v3 Certificate - Token Security Policy Basic256

Definition at line 370 of file ua_types.h.

#define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_Basic256Sha256   (1<<8)

User Token X509v3 Certificate - Token Security Policy Basic256Sha256

Definition at line 372 of file ua_types.h.

#define OB_SUPPRESS_CERTIFICATE_EXPIRED   (1<<0)

Bit definitions for a bitmap that allows you to modify the behaviour of the OPC UA Secure Channel Client Certificate handling.

Option Bit - Accept expired certificates

Definition at line 1026 of file ua_types.h.

#define OB_SUPPRESS_HOSTNAME_INVALID   (1<<1)

Option Bit - Do not validate the application hostname

Definition at line 1028 of file ua_types.h.

#define OB_SUPPRESS_REVOCATION_STATUS_UNKNOWN   (1<<2)

Option Bit - If checking certificate CRLs do not reject a certificate if a CRL for the Issuer cannot be found

Definition at line 1031 of file ua_types.h.

#define OB_CHECK_REVOCATION_STATUS_ONLINE   (1<<3)

Option Bit - Look for CRLs online (not currently supported)

Definition at line 1033 of file ua_types.h.

#define OB_CHECK_REVOCATION_STATUS_OFFLINE   (1<<4)

Option Bit - Look for CRLs locally (typically in the local filesystem

Definition at line 1035 of file ua_types.h.

#define OB_USE_DEFAULT_OPTIONS   (1<<5)

Option Bit - Use default options for the PKI provider

Definition at line 1037 of file ua_types.h.

#define OB_TRUST_ALL_CLIENTS_WHEN_TRUST_LIST_IS_EMPTY   (1U<<31)

Option Bit - Trust all client certificates if the trust list is empty

Definition at line 1039 of file ua_types.h.

Typedef Documentation

typedef uint32_t UA_Status_t

Represents an OPC-UA status code.

OPC-UA status codes are defined in opcua_status_codes.h

Definition at line 151 of file ua_types.h.

A structure representing XMLElement values.

Definition at line 186 of file ua_types.h.

A structure representing UTF8 string values.

Definition at line 192 of file ua_types.h.

typedef uint8_t* UA_GUID_t

Represents a GUID as a pointer to an array of 16 bytes.

As an example, GUID “72962B91-FA75-4AE6-8D28-B404DC7DAF63” should be encoded as follows:

Data1 Data2 Data3 Data4 91 2B 96 72 75 FA E6 4A 8D 28 B4 04 DC 7D AF 63

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Definition at line 205 of file ua_types.h.

A configuration structure for Folder address space nodes.

Definition at line 734 of file ua_types.h.

A configuration structure for View address space nodes.

Definition at line 740 of file ua_types.h.

Enumeration Type Documentation

Enumeration of value data types that can be stored in a variable node

Enumerator
UA_TYPE_Invalid 

Invalid type

UA_TYPE_Boolean 

Boolean

UA_TYPE_SByte 

signed byte

UA_TYPE_Byte 

unsigned byte

UA_TYPE_Int16 

signed 16 bit integer

UA_TYPE_UInt16 

unsigned 16 bit integer

UA_TYPE_Int32 

signed 32 bit integer

UA_TYPE_UInt32 

unsigned 32 bit integer

UA_TYPE_Int64 

signed 64 bit integer

UA_TYPE_UInt64 

unsigned 64 bit integer

UA_TYPE_Float 

32 bit single precision floating point

UA_TYPE_Double 

64 bit double precision floating point

UA_TYPE_String 

UTF8 string

UA_TYPE_DateTime 

64 bit signed integer containing date and time

UA_TYPE_Guid 

16 byte long array of unsigned bytes

UA_TYPE_ByteString 

variable length array of unsigned bytes

UA_TYPE_XmlElement 

UTF8 string containing XML

UA_TYPE_NodeId 

Not supported for application

UA_TYPE_ExpandedNodeId 

Not supported for application

UA_TYPE_StatusCode 

Not supported for application

UA_TYPE_QualifiedName 

Not supported for application

UA_TYPE_LocalizedText 

Not supported for application

UA_TYPE_ExtensionObject 

Not supported for application

UA_TYPE_DataValue 

Not supported for application

UA_TYPE_Variant 

Not supported for application

UA_TYPE_Range 

Not supported for application

UA_TYPE_EUInformation 

Not supported for application

Definition at line 55 of file ua_types.h.

56 {
57  UA_TYPE_Invalid = 0,
58  UA_TYPE_Boolean = 1,
59  UA_TYPE_SByte = 2,
60  UA_TYPE_Byte = 3,
61  UA_TYPE_Int16 = 4,
62  UA_TYPE_UInt16 = 5,
63  UA_TYPE_Int32 = 6,
64  UA_TYPE_UInt32 = 7,
65  UA_TYPE_Int64 = 8,
66  UA_TYPE_UInt64 = 9,
67  UA_TYPE_Float = 10,
68  UA_TYPE_Double = 11,
69  UA_TYPE_String = 12,
70  UA_TYPE_DateTime = 13,
71  UA_TYPE_Guid = 14,
72  UA_TYPE_ByteString = 15,
73  UA_TYPE_XmlElement = 16,
74  UA_TYPE_NodeId = 17,
76  UA_TYPE_StatusCode = 19,
80  UA_TYPE_DataValue = 23,
81  UA_TYPE_Variant = 24,
82  UA_TYPE_Range = 884,

Enumeration of server state.

API functions exist to read and write server state. When shutting down the server, the shutdown takes 60 seconds to allow clients an opportunity to disconnect.

Definition at line 94 of file ua_types.h.

95 {
96  opcua_server_state_running = 0,
97  opcua_server_state_failed = 1,
98  opcua_server_state_no_configuration = 2,
99  opcua_server_state_suspended = 3,
100  opcua_server_state_shutdown = 4,
101  opcua_server_state_test = 5,
102  opcua_server_state_communication_fault = 6,
103  opcua_server_state_unknown = 7,
104  end

Enumeration of log message severity.

UAServer_Log_callback() flags the severity of the log message with this type.

Enumerator
UA_LOG_SEVERITY_ERROR 

Error

UA_LOG_SEVERITY_INFO 

Info

Definition at line 113 of file ua_types.h.

114 {

Enumeration of log message data payload type.

UAServer_Log_callback() describes the format of the optional log data payload with this type.

Enumerator
UA_LOG_PAYLOAD_NONE 

No data payload

UA_LOG_PAYLOAD_CSTRING 

String payload

UA_LOG_PAYLOAD_BINARY 

Binary payload

Definition at line 126 of file ua_types.h.

127 {
128  UA_LOG_PAYLOAD_NONE = 0,

Enumeration of monitored item callabck operation type.

UAServer_Callback_monitored_item() uses this type.

Enumerator
UA_MON_ITEM_CREATED 

A monitored item was created

UA_MON_ITEM_MODIFIED 

A monitored item was modified

UA_MON_ITEM_DESTROYED 

A monitored item was destroyed

Definition at line 139 of file ua_types.h.

Node id encoding types for an address space node.

Enumerator
opcua_node_encoding_numeric 

Numeric

opcua_node_encoding_string 

String

opcua_node_encoding_guid 

GUID

opcua_node_encoding_bytestring 

Opaque

Definition at line 645 of file ua_types.h.

Enumeration of asymmetric cipher types.

Enumerator
UA_ASYM_CIPHER_INVALID 

Invalid

UA_ASYM_CIPHER_RSA_PKCS1_v1_5 

RSA-1_5

UA_ASYM_CIPHER_RSA_OAEP 

RSA OAEP (SHA1)

Definition at line 963 of file ua_types.h.

Enumeration of symmetric cipher types.

Enumerator
UA_SYM_CIPHER_INVALID 

invalid

UA_SYM_CIPHER_AES_128_CBC 

AES 128 CBC

UA_SYM_CIPHER_AES_256_CBC 

AES 256 CBC

Definition at line 974 of file ua_types.h.

Enumeration of message digest types.

Enumerator
UA_DIGEST_INVALID 

Invalid

UA_DIGEST_SHA1 

SHA1

UA_DIGEST_SHA256 

SHA256

Definition at line 985 of file ua_types.h.

986 {
987  UA_DIGEST_INVALID = 0,
988  UA_DIGEST_SHA1 = 1,
989  UA_DIGEST_SHA256 = 2
990 } UA_Digest_t;

Enumeration of message security policies.

Enumerator
SECURITY_POLICY_INVALID 

Invalid

SECURITY_POLICY_NONE 

No security

SECURITY_POLICY_BASIC128RSA15 

SecurityPolicyBasic128Rsa15

SECURITY_POLICY_BASIC256 

SecurityPolicyBasic256

SECURITY_POLICY_BASIC256SHA256 

SecurityPolicyBasic256Sha256

Definition at line 996 of file ua_types.h.

Enumeration of X509 certificate types.

Enumerator
UA_CERT_TYPE_INVALID 

Invalid

UA_CERT_TYPE_CLIENT_APPLICATION 

Client Application

UA_CERT_TYPE_SERVER_APPLICATION 

Server Application

UA_CERT_TYPE_APPLICATION_CA 

CA Certificate for an Application

UA_CERT_TYPE_USER 

User

UA_CERT_TYPE_USER_CA 

CA Certificate for a User

Definition at line 1009 of file ua_types.h.

Function Documentation

uint32_t UAServer_Callback_millisecond ( void  )

Function provided by host to enable library to time its internal operations

The library requires a millisecond timer in order to operate. This timer is implemented via a uint32_t which increments every millisecond. The host must implement this function as it is called periodically by the stack.

Returns
A counter that increments every millisecond.
uint32_t UAServer_Callback_pseudeo_random_number ( void  )

Function provided by host to provide pseudo-random numbers

The library requires a pseudo-random number generator in order to operate. The host must implement this function as it is called periodically by the library.

Returns
A pseudo-random number.
void* UAServer_Callback_memcpy ( void *  destination,
const void *  source,
size_t  num 
)

Function provided by host to provide a memcpy implementation

Some platforms can dramatically improve the performance of memcpy for large data blocks by using DMA or other techniques. If required, a custom implementation may be inserted here. Where a custom implementation is not required simply call the standard library implementation.

Parameters
[in]destinationPointer to the destination array where the content is to be copied, type-casted to a pointer of type void*.
[in]sourcePointer to the source of data to be copied, type-casted to a pointer of type const void*.
[in]numNumber of bytes to copy. size_t is an unsigned integral type.
Returns
"destination" is returned.
void* UAServer_Callback_memchr ( const void *  ptr,
int32_t  value,
size_t  num 
)

Function provided by host to provide a memchr implementation

Simply call the standard library implementation.

Parameters
[in]ptrPointer to the block of memory where the search is performed.
[in]valueValue to be located. The value is passed as an int, but the function performs a byte per byte search using the unsigned char conversion of this value.
[in]numNumber of bytes to be analyzed. size_t is an unsigned integral type.
Returns
A pointer to the first occurrence of value in the block of memory pointed by ptr. If the value is not found, the function returns a null pointer.
void* UAServer_Callback_memset ( void *  ptr,
int32_t  value,
size_t  num 
)

Function provided by host to provide a memset implementation

Simply call the standard library implementation.

Parameters
[in]ptrPointer to the block of memory to fill.
[in]valueValue to be set. The value is passed as an int, but the function fills the block of memory using the unsigned char conversion of this value.
[in]numNumber of bytes to be set to the value. size_t is an unsigned integral type.
Returns
"ptr" is returned.
int UAServer_Callback_memcmp ( const void *  ptr1,
const void *  ptr2,
size_t  num 
)

Function provided by host to provide a memcmp implementation

Simply call the standard library implementation.

Parameters
[in]ptr1Pointer to block of memory.
[in]ptr2Pointer to block of memory.
[in]numNumber of bytes to compare.
Returns
Returns an integral value indicating the relationship between the content of the memory blocks: A zero value indicates that the contents of both memory blocks are equal. A value greater than zero indicates that the first byte that does not match in both memory blocks has a greater value in ptr1 than in ptr2 as if evaluated as unsigned char values; And a value less than zero indicates the opposite.
char* UAServer_Callback_strncpy ( char *  destination,
const char *  source,
size_t  num 
)

Function provided by host to provide a strncpy implementation

Simply call the standard library implementation.

Parameters
[in]destinationPointer to the destination array where the content is to be copied.
[in]sourceC string to be copied.
[in]numMaximum number of characters to be copied from source. size_t is an unsigned integral type.
Returns
Returns an integral value indicating the relationship between the content of the memory blocks: A zero value indicates that the contents of both memory blocks are equal. A value greater than zero indicates that the first byte that does not match in both memory blocks has a greater value in ptr1 than in ptr2 as if evaluated as unsigned char values; And a value less than zero indicates the opposite.
void* UAServer_Callback_malloc ( size_t  size)

Function provided by host to provide a malloc implementation

Simply call the standard library implementation.

Parameters
[in]sizeSize of the memory block, in bytes. size_t is an unsigned integral type.
Returns
On success, a pointer to the memory block allocated by the function. The type of this pointer is always void*, which can be cast to the desired type of data pointer in order to be dereferenceable. If the function failed to allocate the requested block of memory, a null pointer is returned.
void UAServer_Callback_free ( void *  ptr)

Function provided by host to provide a free implementation

Simply call the standard library implementation.

Parameters
[in]ptrPointer to a memory block previously allocated with malloc, calloc or realloc.
Returns
None.
int64_t UAServer_Callback_datetime ( void  )

Function provided by host to enable library to obtain current date and time

The library requires the current date and time in order to operate. This timer is implemented via an int64_t which represents UTC time and data in accordance with Windows FILETIME. This is the number of 100ns intervals since January 1, 1601. The host must implement this function as it is called periodically by the library.

Returns
Current date and time.
void UAServer_Callback_read ( uint32_t  node_handle,
UA_Value_type_t  value_type,
uint32_t  max_array_length,
uintptr_t  read_context 
)

Function provided by host to enable library to read values

The library requires the ability to read values from the host system in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library and the implemented function must call UA_Perform_read() in order to perform the actual read operation.

Parameters
[in]node_handleA unique identifier that the host can use to efficiently look up the value.
[in]value_typeIn order to keep the API lean, this function returns the variable to the library via a non type safe void pointer. The value_type parameter provides run-time type safety by specifying the data type the library expects for the value attribute of the node and allowing the host to verify this against the node handle provided by the library.
[in]max_array_lengthSimilar to the value_type parameter, the max_array_length parameter facilitates run-time type safety by specifying the max array length the library expects for the provided pointer allowing the host to verify this against the node handle provided by the library.
[in]read_contextA pointer to an opaque data structure providing context to the pending read operation. The host must pass this pointer to UA_Perform_read().
UA_Status_t UAServer_Perform_read ( uintptr_t  read_context,
UA_Value_t  data_value,
int64_t  source_timestamp,
UA_Status_t  status_code 
)

Performs a read operation

The host calls this function from UA_Read_callback() to perform a read on the requested node.

Parameters
[in]read_contextA pointer to an opaque data structure providing context to the pending read operation. The user must pass this pointer to UA_Perform_read().
[in]data_valueA pointer to the value required to be read by the library or 0 if the input parameters failed verification or the value is not readable. The value would not be readable if the host system's connection to the underlying data source was unavailable. In this case the host may decide to simply return the most recent cached value (with a corresponding old timestamp) or may return 0 in order to indicate that the data cannot be read.
[in]source_timestampEach time the host value is updated by the host, the host should timestamp the update. This timestamp is provided to the library via this parameter and communicated to the client in the DataValue structure.
[in]status_codeFor Data Access variable types the user must provide a data quality status code to inform the client as to the status of the data read. For base data variable calls this value is ignored by the library and the server returns Bad_NotReadable if the call provides a 0 data_value pointer. For Data Access variables it is expected that the user will write the correct data quality value into this parameter on every call. For some systems only a couple of the available values may be relevant and in this case it is not necessary to use them all.
Returns
The result of the operation.
bool_t UAServer_Is_read_operation_asynchronous ( uintptr_t  read_context)

Is the current read callback invoked due to an asynchronous read request or a monitored item sample?

This function can only be called from UAServer_Callback_read().

Parameters
[in]read_contextThe read context provided by the SDK.
Returns
TRUE if the read is part of an OPC UA Read Service Call.
bool_t UAServer_Is_read_operation_deferrable ( uintptr_t  read_context)

Can the current read operation be deferred if we have to obtain the data value from a slow remote data source?

This function can only be called from UAServer_Callback_read().

Parameters
[in]read_contextThe read context provided by the SDK.
Returns
TRUE if the read operation can be deferred.
bool_t UAServer_Is_read_operation_deferred ( uintptr_t  read_context)

Is the current read operation a repeat of an operation that was previously deferred?

This function can only be called from UAServer_Callback_read().

Parameters
[in]read_contextThe read context provided by the SDK.
Returns
TRUE if the read operation was previously deferred deferred.
UA_Status_t UAServer_Defer_read_operation ( uintptr_t  read_context,
uintptr_t *  deferral_handle 
)

Defer the current read operation as we have to obtain the data from a slow remote data source and doing so synchronously would degrade server response for all connected clients.

This function can only be called from UAServer_Callback_read().

Parameters
[in]read_contextThe read context provided by the SDK.
[out]deferral_handleA unique handle representing this specific deferral.
Returns
OpcUa_Good if the deferral was successful.
UA_Status_t UAServer_Read_deferral_complete ( uintptr_t  deferral_handle,
UA_Status_t  status_code 
)

The read deferral is complete.

The application notifies the SDK that the data has been obtained from the data source and is now available for reading. After making this call the SDK will immediately call UAServer_Callback_read() again. This function must NOT be called from any server callback function.

Parameters
[in]deferral_handleThe deferral handle provided by the SDK.
[out]status_codeThe result of the asynchronous read operation.
Returns
OpcUa_Good if the call was successful.
void UAServer_Callback_deferred_read_operation_aborted ( uintptr_t  deferral_handle)

The deferred read operation is aborted.

The application has previously deferred a read operation and received a deferral handle for the deferred read. This call indicates that the deferral operation has been cancelled by the SDK. This could be due to the client closing the session that the read operation is associated with. After receiving this callback the application must NOT call UAServer_Read_deferral_complete() with this deferral handle as this will result in the SDK dereferencing a free'd pointer.

Parameters
[in]deferral_handleThe deferral handle provided by the SDK.
void UAServer_Callback_write ( uint32_t  node_handle,
UA_Value_type_t  value_type,
UA_Status_t  status_code,
uint32_t  max_array_length,
uintptr_t  write_context 
)

Function provided by host to enable library to write values

The library requires the ability to write values from the host system in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library and the implemented function must call UA_Perform_write() in order to perform the actual write operation.

Parameters
[in]node_handleA unique identifier that the host can use to efficiently look up the value.
[in]value_typeIn order to keep the API lean, this function returns the variable to the library via a non type safe void pointer. The value_type parameter provides run-time type safety by specifying the data type the library expects for the value attribute of the node and allowing the host to verify this against the node handle provided by the library.
[in]status_codeThe status_code for the value written by the client.
[in]max_array_lengthSimilar to the value_type parameter, the max_array_length parameter facilitates run-time type safety by specifying the max array length the library expects for the provided pointer allowing the host to verify this against the node handle provided by the library.
[in]write_contextA pointer to an opaque data structure providing context to the pending write operation. The user must pass this pointer to UA_Perform_write().
UA_Status_t UAServer_Perform_write ( uintptr_t  write_context,
UA_Value_t  data_value,
int64_t *  source_timestamp,
bool_t  completes_asynchronously,
uint32_t *  new_length_of_array 
)

Performs a write operation

The host calls this function from UA_Write_callback() to perform a write on the requested node.

Parameters
[in]write_contextA pointer to an opaque data structure providing context to the pending write operation. The user must pass this pointer to UA_Perform_write().
[in]data_valueA pointer to the value required to be written by the library or 0 if the input parameters failed verification or the value is not writable. The value would not be writable if the host system's connection to the underlying data source was unavailable. In this case the host may decide to simply provide the most recent cached value (with a corresponding old timestamp) or may provide 0 in order to indicate that the data cannot be written.
[in]source_timestampThe timestamp for the value when written by the client. This may be modified by the library during the write if the client specified a source timestamp.
[in]completes_asynchronouslyIf the write to the underlying system completes asynchronously then this flag should be set. Alternatively if the write to the underlying system completes before the completion of UAServer_Write_callback() this flag should be cleared. The flag affects the result code the library returns to the OPC-UA Client. If the call succeeds and the flag is set the write operation level result is OpcUa_GoodCompletesAsynchronously. if the write succeeds and the flag is not set the write operation level result code is OpcUA_Good.
[out]new_length_of_arrayWhen a client writes to the value attribute of a node containing an array, the client can change the length of the array by writing a complete array that is shorter than the maximum array length. This parameter informs the host what the new array length is after the write in case this information is of interest.
Returns
The result of the operation.
void UAServer_Set_write_operation_level_result_code ( uintptr_t  write_context,
UA_Status_t  result_code 
)

Sets the result code of a write operation

The host can optionally call this function from UA_Write_callback() to revise the result code of a write operation. The Server SDK is a single threaded design and it is highly highly recommended that callbacks are completed promptly in order to reduce server latency and jitter. Where the application performs activities in the callbacks that delay the server by milliseconds server latency and jitter as experienced by the client can be poor. For this reason write operations that complete over a serial line, backplane or other slow medium should be buffered in the application and completed asynchronously. Where it is feasible and desirable to complete a write within the callback this call can be made after UAServer_Perform_write() and before returning from the callback in order to modify the result of the write operation, for example setting a bad operation level result due to a write failure.

Parameters
[in]write_contextA pointer to an opaque data structure providing context to the pending write operation. The user must pass this pointer to UA_Perform_write().
[in]result_codeIf the write to the underlying system completed synchronously after the UAServer_Perform_write() call (i.e. that call only buffered the data prior to the actual physical write) then this parameter specifies the actual write operation level result code. The default result code populated during UAServer_Perform_write() would have been OpcUA_Good.
void UAServer_Callback_monitored_item ( uint32_t  node_handle,
uint32_t  monitored_item_id,
UA_Mon_Item_Callback_Operation_t  operation,
uint64_t  sampling_interval_ms 
)

Function provided by host to enable library to indicate that a monitored item has been created for a variable node

Certain host systems may require notice from the library that a monitored item has been created or destroyed in order to maintain an internal cache of values or otherwise efficiently manage their read operations. This callback function enables a host to do so if it wishes but can be ignored if not required. Hosts must still be prepared to handle read callbacks for variables that are not being monitored (OPC-UA Read Service).

Parameters
[in]node_handleAn identifier that the host can use to efficiently look up the value.
[in]monitored_item_idA unique identifier in the SDK for the monitored item.
[in]operationIndicates if a monitored item has been created, modified (for example had its sample rate change) or destroyed.
[in]sampling_interval_msThe sampling interval in milliseconds.
const UA_UTF8_string_t* UAServer_Callback_translate ( uint16_t  locale_index,
uint32_t  text_handle 
)

Function provided by host to enable library to translate text

The library requires the ability to translate human readable text in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library to get a pointer to the appropriate text for communication to a client using a specified and supported locale. This function is used to lookup translations for nodes created by the host system. A separate callback is used to lookup translations for internal text that the library uses to expose standard OPC-UA nodes in the address space.

Parameters
[in]locale_indexThe index into the previously provided locale table. Ignore if only one locale was provided.
[in]text_handleAn identifier that the host can use to efficiently look up the text string.
Returns
A pointer to the text required to be communicated to the client, or 0 if the text cannot be found. If the library receives a return value of 0 it will retry with a variety of supported locales until it receives a valid result or all locales have been tried.
const UA_UTF8_string_t* UAServer_Callback_translate_enumstrings ( uint16_t  locale_index,
uint32_t  enum_handle,
uint16_t  enum_index 
)

Function provided by host to enable library to translate enumerated text

The library requires the ability to translate human readable text in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library to get a pointer to the appropriate text for communication to a client using a specified and supported locale. This function is used to lookup translations for nodes created by the host system. A separate callback is used to lookup translations for internal text that the library uses to expose standard OPC-UA nodes in the address space.

MultiStateDiscrete Data Access address space nodes contain an enumeration of possible values with a human readable label for each value of the enumeration. When creating the node the host passes in a handle to the enumeration and the number of values. For translation the library calls this function indicating the enumeration handle provided and the index of the required label.

Parameters
[in]locale_indexThe index into the previously provided locale table. Ignore if only one locale was provided.
[in]enum_handleAn identifier that the host can use to efficiently look up the enumeration.
[in]enum_indexAn index into the value of the enumeration indicating the label to be returned.
Returns
A pointer to the text required to be communicated to the client, or 0 if the text cannot be found. If the library receives a return value of 0 it will retry with a variety of supported locales until it receives a valid result or all locales have been tried.
const UA_UTF8_string_t* UAServer_Callback_translate_internal_text ( uint16_t  locale_index,
uint32_t  text_index 
)

Function provided by host to enable library to translate internal text

The library exposes some standard OPC-UA nodes in the server address space. It may be desirable to translate the DisplayNames of these nodes. This API callback is provided to facilitate translation of this text. If you do not wish to provide translation of the internal text, simply return the default English text to the library. If you do wish to provide translated text for the internal text you should implement tables of UTF8 strings for each supported locale. Note: There is no requirement in the OPC-UA standard to provide translations of the internal text even if your server supports multiple locales. In this case nodes you add to the address space will be localized but the standard OPC-UA nodes will not.

Parameters
[in]locale_indexThe index into the previously provided locale table. Ignore if no table was provided.
[in]text_indexAn identifier that the host can use to efficiently look up the text string (a zero based table index).
Returns
A pointer to the text required to be communicated to the client, or 0 if the text cannot be found. If the library receives a return value of 0 it will retry with a variety of supported locales until it receives a valid result or until all locales have been tried.
bool_t UAServer_Callback_login_username_password ( const UA_UTF8_string_t *  username,
const UA_UTF8_string_t *  password,
uint16_t *  user_index 
)

Function provided by host to enable users to login

The library optionally requires the ability to authenticate users in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library to authenticate username/password combinations provided by a client when negotiating a session. The host maintains a table of valid user names and corresponding passwords. If the provided username & password authenticates successfully the host provides the library with a user index. The user index is a value from 1 to 15 indicating the user that has logged in. The user index provided by the host is used in conjunction with the node visibility bit mask to filter nodes visible to the current user.

Parameters
[in]usernameThe user name provided.
[in]passwordThe password provided.
[out]user_indexThe user index for this user. Must be set if function returns true.
Returns
True if user authenticates successfully, else false.
bool_t UAServer_Callback_login_x509_certificate ( const UA_Byte_string_t *  certificate,
const UA_UTF8_string_t *  thumbprint,
uint16_t *  user_index 
)

Function provided by host to enable users to login

The library optionally requires the ability to authenticate users in order to operate. This ability is provided by this function which must be implemented by the host system although it is only necessary to handle the callback if the host configures the SDK to support X509 certificates for user authentication.

This function is called by the library to authenticate X509V3 certificates provided by a client when negotiating a session. The host maintains a table of valid certificates. If the provided thumbprint authenticates successfully the host provides the library with a user index. The user index is a value from 1 to 15 indicating the user that has logged in. The user index provided by the host is used in conjunction with the node visibility bit mask to filter nodes visible to the current user.

The certificate is provided here purely as a convenience to hosts that are interested in it. Only the thumbprint is required to identify the certificate and authenticate a user.

This callback will only be executed if the certificate first validates for trust, content, etc. using the user certificate trust and issuer stores.

Parameters
[in]certificateThe certificate provided by the client in DER format.
[in]thumbprintThe certificate thumbprint.
[out]user_indexThe user index for this user. Must be set if function returns true.
Returns
True if user authenticates successfully, else false.
void UAServer_Callback_File_Size ( uint32_t  node_handle,
uintptr_t  context 
)

Function provided by host to enable file size to be reported

The function UAServer_File_Size_result() must be called within this function body to complete the operation.

Parameters
[in]node_handleThe handle of the FileType node identifying the file in the address space.
[in]contextA handle to the operation context which is passed to the library via UAServer_File_Open_result() to complete the operation.
UA_Status_t UAServer_File_Size_result ( uintptr_t  context,
uint64_t  size,
UA_Status_t  result 
)

Function to complete file size operation

This function must be called within the body of function UAServer_Callback_File_Size() to complete the operation.

Parameters
[in]contextA handle to the operation context received from UAServer_Callback_File_Size().
[in]sizeThe current size of the file in bytes.
[in]result0 Success. Bad_UnexpectedError See Part 4 for a general description. Bad_NotFound See Part 4 for a general description.
Returns
OPC-UA Status Code 0 Success. >0 Failure.
void UAServer_Callback_File_Open ( uint32_t  node_handle,
uint8_t  mode,
uintptr_t  context 
)

Function provided by host to enable files to be opened

Open is used to open a file represented by an Object of FileType. When a client opens a file it gets a file handle that is valid while the session is open. Clients shall use the Close Method to release the handle when they do not need access to the file anymore. Clients can open the same file several times for read. A request to open for writing shall return Bad_NotWritable when the file is already opened. A request to open for reading shall return Bad_NotReadable when the file is already opened for writing.

The function UAServer_File_Open_result() must be called within this function body to complete the operation.

Parameters
[in]node_handleThe handle of the FileType node identifying the file in the address space.
[in]modeIndicates whether the file should be opened only for read operations or for read and write operations and where the initial position is set. The mode is an 8-bit unsigned integer used as bit mask with the structure defined in the following table:

Field Bit Description

Read 0 The file is opened for reading. If this bit is not set the Read Method cannot be executed.

Write 1 The file is opened for writing. If this bit is not set the Write Method cannot be executed.

EraseExisiting 2 This bit can only be set if the file is opened for writing (Write bit is set). The existing content of the file is erased and an empty file is provided.

Append 3 When the Append bit is set the file is opened at end of the file, otherwise at begin of the file. The SetPosition Method can be used to change the position.

Reserved 4:7 Reserved for future use. Shall always be zero..

Parameters
[in]contextA handle to the operation context which is passed to the library via UAServer_File_Open_result() to complete the operation.
UA_Status_t UAServer_File_Open_result ( uintptr_t  context,
uint32_t  file_handle,
UA_Status_t  result 
)

Function to complete file open operation

This function must be called within the body of function UAServer_Callback_File_Open() to complete the operation.

Parameters
[in]contextA handle to the operation context received from UAServer_Callback_File_Open().
[in]file_handleA handle for the file used in other method calls indicating not the file (this is done by the Object of the Method call) but the access request and thus the position in the file. The fileHandle is generated by the server and is unique for the Session. Clients cannot transfer the fileHandle to another Session but need to get a new fileHandle by calling the Open Method.
[in]result0 Success. Bad_NotReadable See Part 4 for a general description. File might be locked and thus not readable. Bad_NotWritable See Part 4 for a general description. Bad_InvalidState See Part 4 for a general description. The file is locked and thus not writable. Bad_InvalidArgument See Part 4 for a general description. Mode setting is invalid. Bad_UnexpectedError See Part 4 for a general description. Bad_NotFound See Part 4 for a general description.
Returns
OPC-UA Status Code 0 Success. >0 Failure.
void UAServer_Callback_File_Close ( uint32_t  node_handle,
uint32_t  file_handle,
uintptr_t  context 
)

Function provided by host to enable files to be closed

Close is used to close a file represented by a FileType. When a client closes a file the handle becomes invalid.

The function UAServer_File_Close_result() must be called within this function body to complete the operation.

Parameters
[in]node_handleThe handle of the FileType node identifying the file in the address space.
[in]file_handleA handle indicating the access request and thus indirectly the position inside the file.
[in]contextA handle to the operation context which is passed to the library via UAServer_File_Close_result() to complete the operation.
UA_Status_t UAServer_File_Close_result ( uintptr_t  context,
UA_Status_t  result 
)

Function to complete file close operation

This function must be called within the body of function UAServer_Callback_File_Close() to complete the operation.

Parameters
[in]contextA handle to the operation context received from UAServer_Callback_File_Close().
[in]result0 Success. Bad_InvalidArgument See Part 4 for a general description. Invalid file handle in call.
Returns
OPC-UA Status Code 0 Success. >0 Failure.
void UAServer_Callback_File_Read ( uint32_t  node_handle,
uint32_t  file_handle,
int32_t  length,
uintptr_t  context 
)

Function provided by host to enable files to be read

Read is used to read a part of the file starting from the current file position. The file position is advanced by the number of bytes read.

The function UAServer_File_Read_result() must be called within this function body to complete the operation.

Parameters
[in]node_handleThe handle of the FileType node identifying the file in the address space.
[in]file_handleA handle indicating the access request and thus indirectly the position inside the file.
[in]lengthDefines the length in byte that should be returned in data, starting from the current position of the file handle. If the end of file is reached only all data till the end of the file are returned. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size are returned. Only positive values are allowed.
[in]contextA handle to the operation context which is passed to the library via UAServer_File_Read_result() to complete the operation.
UA_Status_t UAServer_File_Read_result ( uintptr_t  context,
UA_Byte_string_t  data,
UA_Status_t  result 
)

Function to complete file read operation

This function must be called within the body of function UAServer_Callback_File_Read() to complete the operation.

Parameters
[in]contextA handle to the operation context received from UAServer_Callback_File_Read().
[in]dataThe data to be read.
[in]result0 Success. Bad_InvalidState See Part 4 for a general description. File was not opened for read access. Bad_InvalidArgument See Part 4 for a general description. Invalid file handle in call or non positive length. Bad_UnexpectedError See Part 4 for a general description.
Returns
OPC-UA Status Code 0 Success. >0 Failure.
void UAServer_Callback_File_Write ( uint32_t  node_handle,
uint32_t  file_handle,
UA_Byte_string_t  data,
uintptr_t  context 
)

Function provided by host to enable files to be written

Write is used to write a part of the file starting from the current file position. The file position is advanced by the number of bytes written.

The function UAServer_File_Write_result() must be called within this function body to complete the operation.

Parameters
[in]node_handleThe handle of the FileType node identifying the file in the address space.
[in]file_handleA handle indicating the access request and thus indirectly the position inside the file.
[in]dataContains the data to be written at the position of the file. It is server-dependent whether the written data are persistently stored if the session is ended without calling the Close Method with the fileHandle.
[in]contextA handle to the operation context which is passed to the library via UAServer_File_Write_result() to complete the operation.
UA_Status_t UAServer_File_Write_result ( uintptr_t  context,
UA_Status_t  result 
)

Function to complete file write operation

This function must be called within the body of function UAServer_Callback_File_Write() to complete the operation.

Parameters
[in]contextA handle to the operation context received from UAServer_Callback_File_Write().
[in]result0 Success. Bad_InvalidArgument See Part 4 for a general description. Invalid file handle in call. Bad_NotWritable See Part 4 for a general description. File might be locked and thus not writable. Bad_InvalidState See Part 4 for a general description. File was not opened for write access.
Returns
OPC-UA Status Code 0 Success. >0 Failure.
void UAServer_Callback_File_GetPosition ( uint32_t  node_handle,
uint32_t  file_handle,
uintptr_t  context 
)

Function provided by host to enable file positions to be read

GetPosition is used to provide the current position of the file handle.

The function UAServer_File_GetPosition_result() must be called within this function body to complete the operation.

Parameters
[in]node_handleThe handle of the FileType node identifying the file in the address space.
[in]file_handleA handle indicating the access request and thus indirectly the position inside the file.
[in]contextA handle to the operation context which is passed to the library via UAServer_File_GetPosition_result() to complete the operation.
UA_Status_t UAServer_File_GetPosition_result ( uintptr_t  context,
uint64_t  position,
UA_Status_t  result 
)

Function to complete file open operation

This function must be called within the body of function UAServer_Callback_File_GetPosition() to complete the operation.

Parameters
[in]contextA handle to the operation context received from UAServer_Callback_File_GetPosition().
[in]positionThe position of the fileHandle in the file. If a Read or Write is called it starts at that position.
[in]result0 Success. Bad_InvalidArgument See Part 4 for a general description. Invalid file handle in call.
Returns
OPC-UA Status Code 0 Success. >0 Failure.
void UAServer_Callback_File_SetPosition ( uint32_t  node_handle,
uint32_t  file_handle,
uint64_t  position,
uintptr_t  context 
)

Function provided by host to enable file positions to be written

SetPosition is used to set the current position of the file handle.

The function UAServer_File_SetPosition_result() must be called within this function body to complete the operation.

Parameters
[in]node_handleThe handle of the FileType node identifying the file in the address space.
[in]file_handleA handle indicating the access request and thus indirectly the position inside the file.
[in]positionThe position to be set for the fileHandle in the file. If a Read or Write is called it starts at that position. If the position is higher than the file size the position is set to the end of the file.
[in]contextA handle to the operation context which is passed to the library via UAServer_File_SetPosition_result() to complete the operation.
UA_Status_t UAServer_File_SetPosition_result ( uintptr_t  context,
UA_Status_t  result 
)

Function to complete file set position operation

This function must be called within the body of function UAServer_Callback_File_SetPosition() to complete the operation.

Parameters
[in]contextA handle to the operation context received from UAServer_Callback_File_SetPosition().
[in]result0 Success. Bad_InvalidArgument See Part 4 for a general description. Invalid file handle in call.
Returns
OPC-UA Status Code 0 Success. >0 Failure.
int64_t UAServer_Get_datetime ( void  )

Function provided by library to enable host to obtain current date and time

Where the library is using time emulation the callback function for DateTime is not used. THis function allows the host to obtain the date and time in use by the library in order to print accurate log messages as an aid to debugging.

Returns
Current date and time.
void UAServer_Time_emulation_enabled ( bool_t  enable)

Enable time emulation mode

Call this function if the default (disabled) is unsuitable. When enabled, time emulation sets the server date & time from incoming client request packets in order to allow the server to operate with no date and time infrastructure implemented on the host system. In this case, UA_Get_datetime is not called.

Parameters
[in]enableEnable or disable time emulation mode
UA_Status_t UAServer_Initialise ( const UA_Configuration_t *  config)

Initialise the library

This function returns OpcUa_Good if no errors are found during initialisation. If security is excluded from the build all errors are unrecoverable and the server will not start. If security is included in the build errors related to the application instance certificate are recoverable and the server will still start.

Specifically:

OpcUa_BadNoValidCertificates. An application instance certificate and private key are not found. The initialisation was successful but a certificate must be created or installed in order to proceed successfully.

OpcUa_BadSecurityChecksFailed. The application instance certificate failed validation for an undetermined reason (it may be corrupted). The initialisation was successful but if a new certificate is not created or installed the server may not interoperate correctly.

OpcUa_BadCertificateTimeInvalid. The application instance certificate failed validation due to an invalid time (it may have expired). The initialisation was successful but if a new certificate is not created or installed the server may not interoperate correctly. Also, operating the server with an expired certificate may be against your stated security policy.

OpcUa_BadCertificateRevoked. The application instance certificate failed validation because it has been revoked or because the CA CRL could not be found offline. The initialisation was successful but if a new certificate is not created or installed the server may not interoperate correctly. Also, operating the server with a revoked certificate may be against your stated security policy. It is possible that this error is generated due to initialising the server with an incorrect option bit configuration. To avoid this initialise the server before setting validation option bits.

Parameters
[in]configThe requested server configuration data structure.
Returns
The result of the operation.
void UAServer_Terminate ( void  )

Terminate the library

Releases all resources allocated by the library. Not required to be called in a typical embedded environment.

UA_Status_t UAServer_memory_info ( uint32_t *  total_memory_provided,
uint32_t *  memory_unusable,
uint32_t *  max_memory_used_this_run,
uint32_t *  total_memory_recommended 
)

Get information about the memory utilisation

Parameters
[out]total_memory_providedThe total memory provided to the SDK.
[out]memory_unusableThe memory that is unusable due to the characteristics of the allocator. Modifying the amount of memory provided by this amount results in optimum efficiency.
[out]max_memory_used_this_runThe maximum memory used since the server was started.
[out]total_memory_recommendedThe total memory recommended. This assumes that the server has been stressed to the maximum degree likely to be encountered in the field. The max_memory_used_this_run is multiplied by a 1.5 safety margin. total_memory_recommended is calculated based on the maximum amount of memory used by the server since initialisation. If the server memory utilisation has not been exercised to the maximum then the recommended figure is meaningless. Operating the server with less than total_memory_recommended bytes can result in failure over time due to exhaustion of the memory subsystem.
Returns
The result of the operation. The output arguments are only valid if the return value == OpcUa_Good.
UA_Status_t UAServer_Set_URI ( const char *  uri)

Set Server URI

The OPC-UA Server must be given a unique name or Universal Resource Identifier (URI). This name will be cached by clients that regularly connect to the server so for any particular device, the name must be constant. This name can be stored in non-volatile storage as a constant, or alternatively can be calculated dynamically during startup based on the machine MAC address or some other constant, unique value. The URI can be in any format. We recommend using the URN (Uniform Resource Name) UUID (Universally Unique IDentifier) format as follows: "urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66"

Parameters
[in]uriA null terminated ANSI C string containing the URI.
Returns
The result of the operation.
UA_Status_t UAServer_Start ( const char *  license)

Start Server

Must be called in order to start the server.

Parameters
[in]licenseSome distributions require a license string in order to start. If your distribution does not require a license string simply provide a NULL pointer.
Returns
The result of the operation.
UA_Status_t UAServer_Stop ( void  )

Stop Server

Must be called in order to stop the server.

Returns
The result of the operation.
UA_Server_state_t UAServer_Get_state ( bool_t *  shutdown_complete)

Get Server State

Reads the current server state.

Parameters
[out]shutdown_completeIf the server state is shutdown, the server may be in the process of shutting down. In this state this variable informs the host whether or not the shutdown is complete.
Returns
The result of the operation.
UA_Status_t UAServer_Generate_certificate ( void  )

Generate Application instance Certificate

The OPC-UA Server optionally requires an x509 application instance certificate. Version 1.02 of the OPC-UA Standard made this certificate optional for servers that do not support secure channels (x509 authentication and encryption) but for backward compatibility with OPC-UA Clients designed to version 1.01 of the standard it it is recommended to always generate a certificate. This certificate contains the server URI and server hostnames or IP addresses. If this information changes the server certificate must be regenerated by calling this function. This function creates a certificate including signing of the certificate using RSA encryption. This is a resource intensive operation so (depending on your platform) should only be done once during initialisation.

Returns
The result of the operation.
UA_Status_t UAServer_Get_certificate_size ( uint32_t *  size_in_bytes)

Read Application instance Certificate size

Certificate generation via UAServer_Generate_certificate() is a resource intensive operation that can be very slow on some platforms. If the IP Address or Hostname of the server remains the same then the generated certificate will be the same each time. Instead of generating the certificate on every POST, the certificate can be generated (on a development system or on the target) once and then provided at POST in order to shorten boot time.

Provides the size of the generated certificate to facilitate the host application allocating sufficient memory to read out the certificate.

Parameters
[out]size_in_bytesThe size of the generated certificate in bytes.
Returns
The result of the operation.
UA_Status_t UAServer_Read_certificate ( UA_Byte_string_t *  certificate)

Read Application instance Certificate

Certificate generation via UAServer_Generate_certificate() is a resource intensive operation that can be very slow on some platforms. If the IP Address or Hostname of the server remains the same then the generated certificate will be the same each time. Instead of generating the certificate on every POST, the certificate can be generated (on a development system or on the target) once and then provided at POST in order to shorten boot time.

Copies the generated certificate into the byte string provided.

Parameters
[out]certificateThe generated certificate is copied into the preallocated byte string.
Returns
The result of the operation.
UA_Status_t UAServer_Write_certificate ( UA_Byte_string_t *  certificate)

Write Application instance Certificate

Certificate generation via UAServer_Generate_certificate() is a resource intensive operation that can be very slow on some platforms. If the IP Address or Hostname of the server remains the same then the generated certificate will be the same each time. Instead of generating the certificate on every POST, the certificate can be generated (on a development system or on the target) once and then provided at POST in order to shorten boot time.

Copies the certificate from the byte string provided.

Parameters
[in]certificateThe certificate is copied into the server from the byte string.
Returns
The result of the operation.
UA_Status_t UAServer_Add_IP_address ( uint8_t *  ip_address)

Adds an IP address of a network interface

Where the target device does not have a Hostname, the stack requires the IP Address of the network interface in order to generate URI's and application instance certificates. Up to MAX_IP_ADDRESSES may be added. In general, IPAddresses should NOT be added where a Hostname has already been added.

Parameters
[in]ip_addressA 4-byte long byte array containing the IP Address of the network interface. Example: "192.168.2.1" == { 0xC0, 0xA8, 0x02, 0x01 }
Returns
The result of the operation.
UA_Status_t UAServer_Clear_all_IP_addresses ( void  )

Clears the list of IP addresses

It is possible that when using DHCP, an IP Address may change during server operation. In this case the list of IP addresses must be cleared by calling this function followed immediately by one or more calls to UA_Tcpip_add_IP_address(). It is only required to use this function where the device has no Hostname and is using DHCP for IP Address assignment.

Returns
The result of the operation.
UA_Status_t UAServer_Add_hostname ( const char *  hostname)

Adds a Hostname of the device

Where the target device has a Hostname, the stack requires this name in order to generate URI's and application instance certificates. Up to MAX_HOSTNAMES may be added. IPAddresses should NOT be added where a Hostname has already been added.

Parameters
[in]hostnameA null terminated ANSI C string containing the hostname.
Returns
The result of the operation.
UA_Status_t UAServer_Clear_all_hostnames ( void  )

Clears the list of host names

Host names rarely change. However, should a hostname change during server operation it is required to clear the internal list of names and immediately populate the list with the new name(s) using UA_Tcpip_add_hostname().

Returns
The result of the operation.
UA_Status_t UAServer_New_connection ( uint64_t  connection_id)

Informs the library that a new TCPIP connection has been made

Whenever a new TCPIP connection is made on the UA Server listening TCP PORT the host must call this function.

Parameters
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
Returns
The result of the operation.
UA_Status_t UAServer_Connection_closed ( uint64_t  connection_id)

Informs the library that a TCPIP connection has been terminated

Whenever a TCPIP connection is closed or aborted on the UA Server listening TCP PORT the host must call this function.

Parameters
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
Returns
The result of the operation.
void UAServer_Callback_close_connection ( uint64_t  connection_id)

Instructs the host application to close the socket

Whenever a TCP Binary connection is closed the library informs the host application to close the corresponding socket.

Parameters
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
UA_Status_t UAServer_New_data_received ( void *  read_context,
uint64_t  connection_id 
)

Informs the library that new data has been received

Whenever new data is received on an active TCPIP connection the host must call this function. The library responds by calling UAServer_Callback_data_receive()

Parameters
[in]read_contextA pointer to an application specific data structure providing context to the pending read operation. The library will pass this pointer to UAServer_Receive_data_callback().
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
Returns
The result of the operation.
bool_t UAServer_Callback_data_receive ( void *  application_context,
uint64_t  connection_id,
uint8_t *  buffer,
uint32_t  max_length_in_bytes,
uint32_t *  no_of_bytes_received 
)

Read new data from TCP/IP stack

Whenever new data is received on an active TCPIP connection the library calls this function in response to UAServer_New_data_received()

Parameters
[in]application_contextA pointer to an application specific data structure providing context to the pending read operation. The host must pass this pointer to UAServer_New_data_received().
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
[in]bufferA pointer to the data buffer
[in]max_length_in_bytesThe maximum length of data to write into the buffer in bytes
[out]no_of_bytes_receivedThe number of bytes read into the buffer
Returns
More data is available to be read.
UA_Status_t UAServer_Get_data_to_send ( void *  write_context,
uint64_t  connection_id 
)

Get queued data to send from the library

When the library has data queued for transmission this function is called in order to send the queued data. The library responds by calling UAServer_Callback_data_send()

Parameters
[in]write_contextA pointer to an application specific data structure providing context to the pending read operation. The library will pass this pointer to UAServer_Send_data_callback().
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
Returns
The result of the operation.
bool_t UAServer_Callback_data_send ( void *  application_context,
uint64_t  connection_id,
uint8_t *  buffer,
uint32_t  no_of_bytes_to_send,
uint32_t *  no_of_bytes_sent 
)

Send new data to TCP/IP stack

The library calls this function in response to UAServer_Get_data_to_send()

Parameters
[in]application_contextA pointer to an application specific data structure providing context to the pending read operation. The host must pass this pointer to UAServer_Get_data_to_send().
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
[in]bufferPointer to the buffer containing the data to send
[in]no_of_bytes_to_sendThe length of data available to send in bytes
[out]no_of_bytes_sentThe number of data bytes sent. If this number equals the no_of_bytes_to_send the library may call the function again to send more data if available.
Returns
The TCP/IP stack can accept more data.
UA_Status_t UAServer_Ready_to_receive ( uint64_t  connection_id,
bool_t *  result 
)

Can the connection receive any more data at present

Parameters
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
[out]resultTrue if the server can receive more data.
Returns
The result of the operation.
void UAServer_Poll ( void  )

Poll library periodically

The library must be polled at the cyclic rate specified in the configuration data structure. No checking is performed internally on timing so the timing behaviour of the server is directly dependent on the accuracy of polling by the application.

UA_Status_t UAServer_Delete_all_nodes ( void  )

Delete all host generated nodes in the address space

Allows the host system to remove all nodes from the address space that it has previously added.

Returns
The result of the operation.
UA_Status_t UAServer_Delete_node ( uint32_t  node_handle)

Delete a specific host generated node from the address space

Allows the host system to remove a specific node from the address space that it has previously added. This function requires additional memory to execute and cannot be performed in the minimal 45kB buffer footprint. Required memory footprint varies but is typically of the order of 5kB to enable this feature for the minimal implementation.

Parameters
[in]node_handleThe handle of the node to be deleted
Returns
The result of the operation.
void UAServer_Init_config_structure_Folder ( UA_Folder_t *  configuration)

Initialise a configuration structure for a new node with default values

In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.

Parameters
[in]configurationA pointer to the configuration data structure for the node
UA_Status_t UAServer_Create_Folder ( const UA_Folder_t *  configuration)

Create a folder node that will contain (or reference) other nodes

Allows the host system to create a folder node in the address space

Parameters
[in]configurationA pointer to the configuration data structure for the node
Returns
The result of the operation.
void UAServer_Init_config_structure_View ( UA_View_t *  configuration)

Initialise a configuration structure for a new node with default values

In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.

Parameters
[in]configurationA pointer to the configuration data structure for the node
UA_Status_t UAServer_Create_View ( const UA_View_t *  configuration)

Create a view node that will contain (or reference) other nodes

Allows the host system to create a view node in the address space. The library supports 15 different views. Each view created will be given a view index of 1 - 15 in the order in which they are created. The view index is used in conjunction with view masks that can be specified for references. See the library user manual for more information about views. A created view is automatically added to the Views folder of the address space.

Parameters
[in]configurationA pointer to the configuration data structure for the node
Returns
The result of the operation.
void UAServer_Init_config_structure_Method ( UA_Method_t *  configuration)

Initialise a configuration structure for a new node with default values

In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.

Parameters
[in]configurationA pointer to the configuration data structure for the node
UA_Status_t UAServer_Create_Method ( const UA_Method_t *  configuration)

Create a method node

Allows the host system to create a method node in the address space. While method nodes can be created they are not functionally supported by the library at present.

Parameters
[in]configurationA pointer to the configuration data structure for the node
Returns
The result of the operation.
void UAServer_Init_config_structure_BaseDataVariable ( UA_BaseDataVariable_t *  configuration)

Initialise a configuration structure for a new node with default values

In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.

Parameters
[in]configurationA pointer to the configuration data structure for the node
UA_Status_t UAServer_Create_BaseDataVariable ( const UA_BaseDataVariable_t *  configuration)

Create a BaseDataVariable node

Allows the host system to create a BaseDataVariable node in the address space

Parameters
[in]configurationA pointer to the configuration data structure for the node
Returns
The result of the operation.
void UAServer_Init_config_structure_DataItem ( UA_DataItem_t *  configuration)

Initialise a configuration structure for a new node with default values

In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.

Parameters
[in]configurationA pointer to the configuration data structure for the node
UA_Status_t UAServer_Create_DataItem ( const UA_DataItem_t *  configuration)

Create a DataItem node

Allows the host system to create a DataItem node in the address space

Parameters
[in]configurationA pointer to the configuration data structure for the node
Returns
The result of the operation.
void UAServer_Init_config_structure_AnalogItem ( UA_AnalogItem_t *  configuration)

Initialise a configuration structure for a new node with default values

In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.

Parameters
[in]configurationA pointer to the configuration data structure for the node
UA_Status_t UAServer_Create_AnalogItem ( const UA_AnalogItem_t *  configuration)

Create an AnalogItem node

Allows the host system to create an AnalogItem node in the address space

Parameters
[in]configurationA pointer to the configuration data structure for the node
Returns
The result of the operation.
void UAServer_Init_config_structure_TwoStateDiscrete ( UA_TwoStateDiscrete_t *  configuration)

Initialise a configuration structure for a new node with default values

In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.

Parameters
[in]configurationA pointer to the configuration data structure for the node
UA_Status_t UAServer_Create_TwoStateDiscrete ( const UA_TwoStateDiscrete_t *  configuration)

Create a TwoStateDiscrete node

Allows the host system to create a TwoStateDiscrete node in the address space

Parameters
[in]configurationA pointer to the configuration data structure for the node
Returns
The result of the operation.
void UAServer_Init_config_structure_MultiStateDiscrete ( UA_MultiStateDiscrete_t *  configuration)

Initialise a configuration structure for a new node with default values

In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.

Parameters
[in]configurationA pointer to the configuration data structure for the node
UA_Status_t UAServer_Create_MultiStateDiscrete ( const UA_MultiStateDiscrete_t *  configuration)

Create a MultiStateDiscrete node

Allows the host system to create a MultiStateDiscrete node in the address space

Parameters
[in]configurationA pointer to the configuration data structure for the node
Returns
The result of the operation.
void UAServer_Init_config_structure_File ( UA_File_t *  configuration)

Initialise a configuration structure for a new node with default values

In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.

Parameters
[in]configurationA pointer to the configuration data structure for the node
UA_Status_t UAServer_Create_File ( const UA_File_t *  configuration)

Create a File node

Allows the host system to create a File node in the address space

Parameters
[in]configurationA pointer to the configuration data structure for the node
Returns
The result of the operation.
UA_Status_t UAServer_Add_to_folder ( uint32_t  folder_handle,
uint32_t  node_handle 
)

Add a node to a folder node

Allows the host system to add a previously created node to a folder. Specifically this creates a reference from the folder node to the target node.

Parameters
[in]folder_handleThe handle of the folder node (source node of the reference)
[in]node_handleThe handle of the node to add to the folder (target node of the reference)
Returns
The result of the operation.
UA_Status_t UAServer_Add_to_folder_with_view_mask ( uint32_t  folder_handle,
uint32_t  node_handle,
uint16_t  view_mask 
)

Add a node to a folder node while specifying a view mask

Allows the host system to add a previously created node to a folder. Specifically this creates a reference from the folder node to the target node. This function allows the host to specify a view mask. This filters the visibility of the reference depending on the view being browsed by the client.

Parameters
[in]folder_handleThe handle of the folder node (source node of the reference)
[in]node_handleThe handle of the node to add to the folder (target node of the reference)
[in]view_maskA bit mask with a bit set for each view where the reference is visible. Bit zero is no view and bits 1 - 15 are the 15 supported views.
Returns
The result of the operation.
UA_Status_t UAServer_Add_to_objects_folder ( uint32_t  node_handle)

Add a node to the objects folder

Allows the host system to add a previously created node to the objects folder. Specifically this creates a reference from the objects folder node to the target node. The objects folder is a standard object that is always present in the address space.

Parameters
[in]node_handleThe handle of the node to add to the objects folder (target node of the reference)
Returns
The result of the operation.
void UAServer_Callback_log ( UA_Log_severity_t  severity,
int64_t  timestamp,
const char *  file_name,
uint32_t  line_number,
UA_Log_payload_t  payload_type,
const void *  payload,
uint32_t  payload_length 
)

A log message from the server stack

Supports debugging of a server implementation.

Parameters
[in]severityThe severity of the log event
[in]timestampThe timestamp of the event
[in]file_nameThe source filename of the file generating the event
[in]line_numberThe source line number of the file generating the event
[in]payload_typeThe type of the payload accompanying the log event
[in]payloadA pointer to payload related to the log event
[in]payload_lengthThe length of the payload related to the log event
void UAServer_Printf ( int64_t  timestamp,
const char *  format,
  ... 
)

A printf message from the server stack

Supports debugging of a server implementation.

Parameters
[in]timestampThe timestamp of the message
[in]formatMessage format string
[in]...Variable argument list
void* UAServer_Malloc ( size_t  size)

Allocate a block of memory from the SDK memory allocation subsystem

If the application needs to perform dynamic memory allocation it can use the SDK memory allocation subsystem rather than a general purpose heap (which in any case may not be available). The allocation must be less than the maximum allocation size specified in the configuration (typically by 8 bytes).

Parameters
[in]sizeThe size in bytes of the required block of memory.
Returns
A pointer to the allocated memory or NULL (0) on failure.
void* UAServer_Calloc ( size_t  size)

Allocate a block of memory from the SDK memory allocation subsystem and zero the block

Parameters
[in]sizeThe size in bytes of the required block of memory.
Returns
A pointer to the allocated memory or NULL (0) on failure.
void* UAServer_Realloc ( void *  ptr,
size_t  size 
)

Increase or decrease the size of a previously allocates a block of memory from the SDK memory allocation subsystem.

Parameters
[in]ptrA pointer previously returned by one of the memory allocation routines.
[in]sizeThe size in bytes of the required block of memory.
Returns
A pointer to the allocated memory or NULL (0) on failure.
void UAServer_Free ( void *  ptr)

Free a memory block previously allocated with UAServer_Malloc(), UAServer_Calloc() or UAServer_Realloc().

Parameters
[in]ptrThe pointer previously returned by one of the memory allocation routines.
UA_Status_t UASecurity_Check_application_certificate_exists ( void  )

Check if the application certificate and corresponding private key are present.

If there is no application certificate present the application may choose to create a default self signed certificate if certificate creation functionality is supported by the PKI component.

Returns
OpcUa_Good if the certificate exists.
UA_Status_t UASecurity_Create_self_signed_certificate ( const UA_Configuration_t *  sdk_configuration,
const char *  server_uri,
const char **  hostnames,
int  no_of_hostnames,
const char **  ip_addresses,
int  no_of_ip_addresses 
)

Create a self signed certificate.

Parameters
[in]sdk_configurationThe configuration structure used to initialise the SDK.
[in]server_uriThe server URI.
[in]hostnamesThe array of hostnames assigned to the host that the server is running on that the server is accessible from.
[in]no_of_hostnamesThe number of hostnames.
[in]ip_addressesThe array of ip addresses assigned to the host that the server is running on that the server is accessible from. If hostnames are available IP addresses should not be used.
[in]no_of_ip_addressesThe number of IP addresses.
Returns
A pointer to the allocated memory or NULL (0) on failure.
UA_Status_t UASecurity_Reload_directory_stores_now ( void  )

Reload the directory certificate stores.

If the PKI component stores certificates in the filesystem it may load the certificates only once on startup. If a certificate is added the application may wish the PKI compnent to reload the stores from the filesystem following the addition.

Returns
OpcUa_Good if the operation succeeds.
void UASecurity_Reload_directory_stores_before_each_validation ( bool_t  enable)

Reload the directory certificate stores before every certificate validation.

If the PKI component stores certificates in the filesystem it may load the certificates only once on startup. If it is possible for certificates to be added or removed from the filesystem at any time and independently of the application the application should instruct the PKI component to reload certificates from the filesystem prior to every validation.

Parameters
[in]enableenable or disable reloading.
UA_Status_t UASecurity_Create_directory_stores ( void  )

Create the directory certificate stores.

Create the filesystem structure required for the certificate stores. There are four certificate stores. There are trusted and issuer stores for both application and user certificates.

Returns
OpcUa_Good if the operation succeeds.
void UASecurity_Set_validation_options ( uint32_t  option_bits)

Alter the behaviour of the certificate validation logic.

Parameters
[in]option_bitsBitmap defining the behaviour required.
UA_Status_t UASecurity_Get_thumbprint ( const char *  filepath,
char *  thumbprint,
uint32_t  thumbprint_max_length 
)

Get the certificate thumbprint.

When storing certificates in a filesystem programmatically the SHA1 thumbprint should be used as the filename for the certificate with the .DER file extension. This ensures that all certificates shall have a unique filename. The OpenSSL PKI component does not make use of this file naming convention but other PKI components may depend on it for correct operation.

Returns
OpcUa_Good if the operation succeeds.
void UASecurity_Callback_get_private_key_password ( UA_Var_string_t *  password)

Provide the password for the application certificate private key file.

Parameters
[out]passwordThe password for the private key PEM file.
void UASecurity_Callback_certificate_added_to_rejected_list ( UA_Certificate_Type_t  type)

A certificate was added to the rejected certificate list.

Parameters
[in]typeThe type of the certificate.